package io.zhile.crack.atlassian.plugins.zephyr;


public class Base64Coder {

    private static char[] map1 = new char[64];

    static {
        /*  35 */
        int i = 0;
        char c;
        /*  36 */
        for (c = 'A'; c <= 'Z'; ) {
            map1[i++] = c;
            c = (char) (c + 1);
        }
        /*  37 */
        for (c = 'a'; c <= 'z'; ) {
            map1[i++] = c;
            c = (char) (c + 1);
        }
        /*  38 */
        for (c = '0'; c <= '9'; ) {
            map1[i++] = c;
            c = (char) (c + 1);
        }
        /*  39 */
        map1[i++] = '+';
        map1[i++] = '/';
    }

    /*  42 */   private static byte[] map2 = new byte[128];

    static {
        /*  44 */
        for (int i = 0; i < map2.length; ) {
            map2[i] = -1;
            i++;
        }
        /*  45 */
        for (int i = 0; i < 64; ) {
            map2[map1[i]] = (byte) i;
            i++;
        }

    }


    public static String encode(String s) {
        /*  54 */
        return new String(encode(s.getBytes()));
    }


    public static char[] encode(byte[] in) {
        /*  65 */
        int iLen = in.length;
        /*  66 */
        int oDataLen = (iLen * 4 + 2) / 3;
        /*  67 */
        int oLen = (iLen + 2) / 3 * 4;
        /*  68 */
        char[] out = new char[oLen];
        /*  69 */
        int ip = 0;
        /*  70 */
        int op = 0;
        /*  71 */
        while (ip < iLen) {
            /*  72 */
            int i0 = in[ip++] & 0xFF;
            /*  73 */
            int i1 = (ip < iLen) ? (in[ip++] & 0xFF) : 0;
            /*  74 */
            int i2 = (ip < iLen) ? (in[ip++] & 0xFF) : 0;
            /*  75 */
            int o0 = i0 >>> 2;
            /*  76 */
            int o1 = (i0 & 0x3) << 4 | i1 >>> 4;
            /*  77 */
            int o2 = (i1 & 0xF) << 2 | i2 >>> 6;
            /*  78 */
            int o3 = i2 & 0x3F;
            /*  79 */
            out[op++] = map1[o0];
            /*  80 */
            out[op++] = map1[o1];
            /*  81 */
            out[op] = (op < oDataLen) ? map1[o2] : '=';
            op++;
            /*  82 */
            out[op] = (op < oDataLen) ? map1[o3] : '=';
            op++;
            /*  83 */
        }
        return out;
    }


    public static String decode(String s) {
        /*  92 */
        return new String(decode(s.toCharArray()));
    }


    public static byte[] decode(char[] in) {
        /* 102 */
        int iLen = in.length;
        /* 103 */
        if (iLen % 4 != 0)
            throw new IllegalArgumentException("Length of Base64 encoded input string is not a multiple of 4.");
        /* 104 */
        for (; iLen > 0 && in[iLen - 1] == '='; iLen--) ;
        /* 105 */
        int oLen = iLen * 3 / 4;
        /* 106 */
        byte[] out = new byte[oLen];
        /* 107 */
        int ip = 0;
        /* 108 */
        int op = 0;
        /* 109 */
        while (ip < iLen) {
            /* 110 */
            int i0 = in[ip++];
            /* 111 */
            int i1 = in[ip++];
            /* 112 */
            int i2 = (ip < iLen) ? in[ip++] : 65;
            /* 113 */
            int i3 = (ip < iLen) ? in[ip++] : 65;
            /* 114 */
            if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127)
                /* 115 */ throw new IllegalArgumentException("Illegal character in Base64 encoded data.");
            /* 116 */
            int b0 = map2[i0];
            /* 117 */
            int b1 = map2[i1];
            /* 118 */
            int b2 = map2[i2];
            /* 119 */
            int b3 = map2[i3];
            /* 120 */
            if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0)
                /* 121 */ throw new IllegalArgumentException("Illegal character in Base64 encoded data.");
            /* 122 */
            int o0 = b0 << 2 | b1 >>> 4;
            /* 123 */
            int o1 = (b1 & 0xF) << 4 | b2 >>> 2;
            /* 124 */
            int o2 = (b2 & 0x3) << 6 | b3;
            /* 125 */
            out[op++] = (byte) o0;
            /* 126 */
            if (op < oLen) out[op++] = (byte) o1;
            /* 127 */
            if (op < oLen) out[op++] = (byte) o2;
            /* 128 */
        }
        return out;
    }
}


/* Location:              C:\Users\Administrator\Desktop\excel\je-6.0.1.jar!\com\thed\zephyr\je\config\license\Base64Coder.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */